/*******************************************************************\
| Light.h
|
| CREATED:		31.3.2009
| DESCRIPTION:
| 
| Abstract light base class
\********************************************************************/
#ifndef LIGHT_H
#define LIGHT_H

namespace PhotonMapping
{

// declare pointer type
class Scene;
typedef std::tr1::shared_ptr<Scene> ScenePtr;

//*****************************************************************************
// class overview:
//  Abstract base class for light types 
//-----------------------------------------------------------------------------
class ILight
{
	public:
		ILight(const Math::Vector3& p_Pos, const Color& p_Color, const float p_Intensity) : m_Pos(p_Pos), m_Color(p_Color), m_Intensity(p_Intensity) { }

	public:
		// create a projection map for the given scene to optimize caustic photon tracing
		virtual void CreateProjectionMap(const ScenePtr p_Ptr) = 0;

		// returns a light ray for photon tracing
		virtual const Math::Ray SampleLightRay(float p_U1, float p_U2) = 0;

		// returns the lights maximum emitted flux
		virtual const Color GetMaxFlux() = 0;

		// returns the lights center position
		const Math::Vector3& GetPosition() const { return m_Pos; }

		// returns the lights color
		const Color& GetColor() const { return m_Color; }

		// returns the lights intensity
		const float GetIntensity() const { return m_Intensity; }

	private:
		// light position
		Math::Vector3 m_Pos;

		// light color
		Color m_Color;

		// light intensity
		float m_Intensity;
};

// declare pointer type
typedef std::tr1::shared_ptr<ILight> LightPtr;

} // namespace PhotonMapping

#endif // LIGHT_H
